import type { postOrPutType } from "@/constants";
import type { IResult } from "@/types/common";
import { getAxios, commonAxiosJson, deleteAxios } from "@/utils/request.ts";
/* 获取 广告类型信息 地址*/
const url = "/back/banner-type";
/* 广告信息：获取 广告类型信息 */
export const getBannerTypeInfo = <T, D>(params?: D): Promise<IResult<T>> => {
  return getAxios<T, D>(url, params);
};
/* 广告信息：新增，修改广告类型信息 */
export const commonBannerTypeInfo = <T, D>(params: D, type: postOrPutType): Promise<IResult<T>> => {
  return commonAxiosJson<T, D>(url, params, type);
};
/* 广告信息：修改广告类型 排序 信息 */
export const putBannerTypeSortInfo = <T, D>(params: D): Promise<IResult<T>> => {
  return commonAxiosJson<T, D>(url + "/update-sort", params, "PUT");
};
/* 广告信息：删除 广告类型信息 */
export const deleteBannerTypeInfo = <T, D>(params: D): Promise<IResult<T>> => {
  return deleteAxios<T, D>(url, params);
};
